<include file="Public/siteTopbar" />
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/slider.js"></script>
<include file="Public/header" />

  
<div class="container usercenter" >

    <include file="User/menu" />

     <div class="col-sm-9">
        <div class="he50 wddd">
            <div class="he50 wddd">
            <div class="page-title">
                <h1 style="float:left;">My Coupon</h1>
                  
                <button type="button" title="Add New Address" class="button" onClick="javascript:window.location='{:U('Home/User/coupon')}';" style="float:right;"><span><span>Coupon List</span></span></button>
            </div>
           
        </div>
           
        </div>
        <div class="wddd-js ov-in">
        
        <table class="data-table" id="my-orders-table">
    <colgroup>
    <col>
    <col>
    <col>
    </colgroup><thead>
        <tr class="first last">
            <th>Coupon Name</th>
            <th>Validity</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
                            <volist name="coupon_list" id="coupon">
        <tr class="first odd" >
            <td>{$coupon.name}</td>
            <td>{$coupon.use_end_time|date='m/d/Y',###}</td>
            <td>
            
            <a href="javascript:void();" onClick="save_coupon({$coupon.id})" class="gopay coupon_{$coupon.id}" style="border: none;">Receive coupons</a></td>
            
        </tr>
        
        </volist>
            
            </tbody>
</table>
        
        
        </div>
        <div>{$page}</div>
    </div>
</div>
<div class="he80"></div>
<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->


</body>


<script language="javascript">



 function save_coupon(id)
 {	 	
		$.ajax({
			type : "GET",
			dataType: "json",
			//url:"{:U('Mobile/Coupon/save_coupon')}",
			url:"/index.php?m=Home&c=User&a=save_coupon&id="+id,//+tab,			
			//data:{id:id},
			success: function(data)
			{
				if(data.status=="-1")
					//$.artTip(data.msg, 800)
					alert(data.msg);
				else  
				{
					
					$(".coupon_"+data.result).css({"background-color":"#797979"});
					$(".coupon_"+data.result).html('Receive success ');
	
					//alert(data.msg);
					
					//$.artTip(data.msg, 800)
				}
			}
		}); 
 }

</script>

</html>>>>